package com.weixing.mall.provider.controller.rpc;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.annotation.SysLog;
import com.weixing.mall.core.enums.OperateEnum;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.api.model.dto.AccessLogDto;
import com.weixing.mall.provider.model.domain.AccessLog;
import com.weixing.mall.provider.model.query.SysAccessLogQuery;
import com.weixing.mall.provider.model.query.SysLoginLogQuery;
import com.weixing.mall.provider.service.IAccessLogService;
import com.weixing.mall.provider.service.ILoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: kfc
 * @Description: <br/>
 * Date:Create in 2019/7/25 16:13
 * @Modified By:
 */
@RestController
@RequestMapping("api/log")
public class SysLogRpcController extends BaseController {

    @Autowired
    private IAccessLogService sysAccessLogService;


    @PostMapping("/saveAccessLog")
    public Result saveAccessLog(@RequestBody AccessLogDto accessLog) {
        AccessLog log = new AccessLog();
        BeanUtils.copyProperties(accessLog, log);
        sysAccessLogService.save(log);
        return ResultUtil.success();
    }

}
